const express = require('express');
const router = new express.Router();

/**
 * @param {Object} options
 * @param {} options.code 编号
 * @param {} options.name 名称
 * @param {} options.status 状态
 * @param {} options.workItemCategoryId 维修项目分类Id，维修项目所关联的分类或其上层分类Id
 * @param {} options.pageSize 每页数据量
 * @param {} options.pageIndex 指定页
 * @param {} options.sortField 排序字段
 * @param {} options.isDesc 倒序排列
 * @throws {Error}
 * @return {Promise}
 */
router.get('/forCurrentUser', async(req, res, next) => {
    const options = {
        code: req.query.code,
        name: req.query.name,
        status: req.query.status,
        workItemCategoryId: req.query.workItemCategoryId,
        pageSize: req.query.pageSize,
        pageIndex: req.query.pageIndex,
        sortField: req.query.sortField,
        isDesc: req.query.isDesc
    };
    const data = {
        message: 'message',
        payload: {
            content: [
                {
                    id: 'id1573',
                    code: 'code1574',
                    name: 'name1575',
                    repairModeId: 'repairModeId1576',
                    repairModeCode: 'repairModeCode1577',
                    repairModeName: 'repairModeName1578',
                    categoryName: 'categoryName1579',
                    status: 1,
                    remark: 'remark',
                    options: [
                        'update',
                        'enable',
                        'disable',
                        'setLaborHour',
                        'setAssist',
                    ],
                    rowVersion: 'rowVersion'
                },
                {
                    id: 'id1580',
                    code: 'code1581',
                    name: 'name1582',
                    repairModeId: 'repairModeId1583',
                    repairModeCode: 'repairModeCode1584',
                    repairModeName: 'repairModeName1585',
                    categoryName: 'categoryName1586',
                    status: 1,
                    remark: 'remark',
                    options: [
                        'update',
                        'enable',
                        'disable',
                        'setLaborHour',
                        'setAssist',
                    ],
                    rowVersion: 'rowVersion'
                }
            ],
            pageIndex: null,
            pageSize: null,
            sort: null,
            totalElements: 50,
            totalPages: null
        }
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @throws {Error}
 * @return {Promise}
 */
router.post('/', async(req, res, next) => {
    const options = {
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @throws {Error}
 * @return {Promise}
 */
router.get('/:id', async(req, res, next) => {
    const options = {
    };
    const data = {
        message: 'message',
        payload: {
            id: 'id1587',
            code: 'code1588',
            name: 'name1589',
            workItemCategoryId: 'workItemCategoryId1590',
            workItemCategoryCode: 'workItemCategoryCode1591',
            workItemCategoryName: 'workItemCategoryName1592',
            repairModeId: 'repairModeId1593',
            repairModeCode: 'repairModeCode1594',
            repairModeName: 'repairModeName1595',
            laborHour: 1,
            status: 1,
            remark: 'remark',
            englishRemark: 'englishRemark',
            options: [
                'update',
                'enable',
                'disable',
                'setLaborHour',
                'setAssist',
            ],
            rowVersion: 'rowVersion',
            workItemPartDetails: [
                {
                    partId: 'partId1596',
                    partCode: 'partCode1597',
                    partName: 'partName1598',
                    laborHour: 1,
                    remark: 'remark'
                },
                {
                    partId: 'partId1599',
                    partCode: 'partCode1600',
                    partName: 'partName1601',
                    laborHour: 1,
                    remark: 'remark'
                }
            ],
            assistItems: [
                {
                    workItemId: 'workItemId1602',
                    workItemCode: 'workItemCode1603',
                    workItemName: 'workItemName1604'
                },
                {
                    workItemId: 'workItemId1605',
                    workItemCode: 'workItemCode1606',
                    workItemName: 'workItemName1607'
                }
            ]
        }
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @throws {Error}
 * @return {Promise}
 */
router.put('/:id', async(req, res, next) => {
    const options = {
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.id 维修项目Id
 * @throws {Error}
 * @return {Promise}
 */
router.put('/:id/disable', async(req, res, next) => {
    const options = {
        id: req.params.id
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.id 维修项目Id
 * @throws {Error}
 * @return {Promise}
 */
router.put('/:id/laborHour', async(req, res, next) => {
    const options = {
        id: req.params.id
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.id 维修项目Id
 * @throws {Error}
 * @return {Promise}
 */
router.put('/:id/enable', async(req, res, next) => {
    const options = {
        id: req.params.id
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.id 维修项目Id
 * @throws {Error}
 * @return {Promise}
 */
router.put('/:id/productCategories', async(req, res, next) => {
    const options = {
        id: req.params.id
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.id 维修项目Id
 * @throws {Error}
 * @return {Promise}
 */
router.put('/:id/assistItems', async(req, res, next) => {
    const options = {
        id: req.params.id
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @throws {Error}
 * @return {Promise}
 */
router.post('/import/forCurrentUser', async(req, res, next) => {
    const options = {
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @throws {Error}
 * @return {Promise}
 */
router.post('/import/forLaborHour', async(req, res, next) => {
    const options = {
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.code 编号
 * @param {} options.name 名称
 * @param {} options.status 状态
 * @param {} options.workItemCategoryId 维修项目分类Id，维修项目所关联的分类或其上层分类Id
 * @param {} options.sortField 排序字段
 * @param {} options.isDesc 倒序排列
 * @throws {Error}
 * @return {Promise}
 */
router.get('/export/forCurrentUser', async(req, res, next) => {
    const options = {
        code: req.query.code,
        name: req.query.name,
        status: req.query.status,
        workItemCategoryId: req.query.workItemCategoryId,
        sortField: req.query.sortField,
        isDesc: req.query.isDesc
    };
    const data = {
        message: 'message',
        payload: 'payload'
    };
    res.json(data);
});
module.exports = router;
